namespace Comteck.Ktt.Services.SeedData {
  /// <summary>
  /// 
  /// </summary>
  public class _20250401002_Index : IDataSeed {
    /// <summary>
    /// 
    /// </summary>
    /// <param name="context"></param>
    public void Init(AppDbContext context) {
      context.Database.ExecuteSqlCommand("create index if not exists ix_product_1 on product(name)");

      context.Database.ExecuteSqlCommand("create index if not exists ix_selforgtagrelation_1 on selforgtagrelation(selforgid)");
      context.Database.ExecuteSqlCommand("create index if not exists ix_selforgtagrelation_2 on selforgtagrelation(tagid)");

      context.Database.ExecuteSqlCommand("create index if not exists ix_saleorderdetail_1 on saleorderdetail(orderid)");
      context.Database.ExecuteSqlCommand("create index if not exists ix_saleorderdetail_2 on saleorderdetail(productid)");

      context.Database.ExecuteSqlCommand("create index if not exists ix_saleorder_1 on saleorder(importtime,status,selforgid)");
      context.Database.ExecuteSqlCommand("create index if not exists ix_saleorder_2 on saleorder(code)");
      context.Database.ExecuteSqlCommand("create index if not exists ix_saleorder_3 on saleorder(maincode,mainorderflag)");
      context.Database.ExecuteSqlCommand("create index if not exists ix_saleorder_4 on saleorder(selforgid);");
    }
  }
}
